package com.jbp.controller;

import com.jbp.model.LuckKeyBuy;
import com.jbp.service.LuckKeyBuyService;
import com.jbp.utils.PageUtils;
import com.jbp.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.Map;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;

/**
 * 钥匙购买记录(LuckKeyBuy)表控制层
 * @author cc
 * @since 2021-04-30 10:53:41
 */
@Api(tags ="APP接口--LuckKeyBuy" )
@RestController
@RequestMapping("luckKeyBuy")
public class LuckKeyBuyController {
    @Autowired
    private LuckKeyBuyService luckKeyBuyService;
    
    @ApiOperation(value="信息")
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Integer id){
        return R.ok(luckKeyBuyService.getById(id) );
    }
    
    /** 保存 */
    @RequestMapping("/save")
    public R save(@RequestBody LuckKeyBuy luckKeyBuy){
        luckKeyBuyService.save(luckKeyBuy);
        return R.ok();
    }

    /** 修改 */
    @RequestMapping("/update")
    public R update(@RequestBody LuckKeyBuy luckKeyBuy){
        luckKeyBuyService.updateById(luckKeyBuy);
        return R.ok();
    }

    /** 删除 */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
        luckKeyBuyService.removeByIds(Arrays.asList(ids));
        return R.ok();
    }
}